<template>
  <div class="main-container">
    <div class="head">
      <div class="search">
        <el-input v-model="input" placeholder="Please input" size="default" style="width: 100%"/>
        <img src="../../assets/校园安全管理系统/搜索.png" @click="selectAll">
      </div>
      <DatePicker/>
    </div>
    <div class="data"><FilingData/></div>
    <div class="foot-container">
      <div class="foot"><Pagination/></div>
      <div class="foot-right">
        <img :src="img_src" @click="selectAll">
        <span style="width: 35px" @click="selectAll">全选</span>
        <el-button size="default">是</el-button>
        <el-button size="default" type="danger">否</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import { ref } from 'vue'
import DatePicker from "./DatePicker.vue";
import FilingData from "./FilingData.vue";
import Pagination from "./Pagination.vue";
import no_pic from "../../assets/校园安全管理系统/全选_未选中.png"
import yes_pic from "../../assets/校园安全管理系统/全选_选中.png"
export default {
  name: "FilingMain",
  components:{
    DatePicker,
    Pagination,
    FilingData
  },
  setup(){
    const input = ref('')
    let img_flag = ref(false)
    let img_src = ref(no_pic)

    /**
     * 动态修改图片src
     */
    function selectAll(){
      img_flag.value = !img_flag.value;
      if(img_flag.value === false){
        img_src.value = no_pic
      }else {
        img_src.value = yes_pic
      }
    }
    return {input, selectAll, img_src}
  }
}
</script>

<style scoped>
/*设置头部样式*/
.head{
  display: flex;
  /*height: 50px;*/
  flex-direction: row;
  align-items: center;
  gap:15px;
  margin-top: -10px;
}
.search{
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 65%;
  padding: 5px;
  border-radius: 5px;
  background: #98caf8;
}
.search img{
  width: 30px;
  height: 30px;
  cursor: pointer;
}
/*设置底部容器样式*/
.foot-container{
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
}
.foot-right{
  position: absolute;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: flex-end;
  right: 0;
}
.foot-right img{
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.foot-right span{
  cursor: pointer;
}

</style>